package com.ncu.sprotapp.Mapper;

import com.ncu.sprotapp.Entity.userEntity;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface UserMapper {
    @Select("select * from s_user")
    List<userEntity> getAll();

    @Select("select * from s_user where userAmount ='${userAmount}'")
    userEntity getOneByName(@Param("userAmount")String userAmount);

    @Insert("INSERT into s_user(userAmount, userPassword,userName) values ('${userAmount}','${userPassword}','${userName}')")
    boolean add( userEntity user);

    @Select("select * from s_user where userAmount = '${userAmount}' and userPassword = '${userPassword}'")
    userEntity login(userEntity user);

    @Update("update  s_user set userAmount = '${userAmount}' where id = '${id}'")
    boolean update(userEntity user);
}
